﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DisplayBoardInfo.Server.Forms.Board
{
    /// <summary>
    /// Interaction logic for List.xaml
    /// </summary>
    public partial class List : UserControl
    {
        public List()
        {
            InitializeComponent();
        }

        public IEnumerable<Network.Messages.Content.Appointment> Appointments
        {
            set 
            {
                listView.Children.Clear();
                foreach (Network.Messages.Content.Appointment item in value)
                { 
                    RowSmall row = new RowSmall();
                    row.PatientNumber = item.Number == null ? 0 : (int)item.Number;
                    row.PatientName = item.Patient.Name + " " + item.Patient.LastName;
                    row.Time = item.ExpectedTime == null ? 0 : (int)item.ExpectedTime;
                    row.Height = 60;
                    listView.Children.Add(row);
                }
            }
        }
    }
}
